package app;

import java.math.BigInteger;

public class Factorial {

    /**
     * @param args
     */
    public static void main(String[] args) {
	
	for(int i=1; i<=25;i++){
	    System.out.println(i+" LONG " +getFactorialLong(i));
	        
	}
	
	for(int i=1; i<=25;i++){
	    System.out.println(i+" BIGINTEGER "+getFactorialBigInteger(i).toString());
	        
	}
	
	
    }
    
    static long getFactorialLong(int number){
	long fact = 1; // this  will be the result	
        for (int i = 1; i <= number; i++) {
            fact *= i;
        }
	return fact;
    }
    
    static BigInteger getFactorialBigInteger(int number){
	BigInteger fact = BigInteger.ONE;
	for (int i = 1; i <= number; i++) {
        fact = fact.multiply(BigInteger.valueOf(i));
	}
	return fact;
    }

}
